<!doctype html>
<html>
	<head>
		<title>羽乐汇</title>
		<meta name="keywords" content="羽毛球，球会，球场，教练">
		<meta name="charset" content="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/CSS/HomePage/bootstrap.min.css">
		<!-- <link rel="stylesheet" type="text/css" href="__PUBLIC__/CSS/HomePage/wap_index.css"> -->
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/CSS/HomePage/index.css">
		
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/jquery.min.js"></script>
		
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/bootstrap.min.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/md5.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/query-object.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/yuleclub.js"></script>
		<script type="text/javascript" src="__PUBLIC__/JS/HomePage/index.js"></script>
    </head>
	<body>
	<!-- ---------------------------------------------------------------pc_index--------------------------------------------------------- -->
		<div class="pc_coach container-fluid">
			<div class="top visible-lg visible-md">
				<div class="ttop">
					<span>欢迎来到羽乐汇</span>
					<div>
						<span class="wellcome"></span>
						<span class="login">
							<button class="login_btn">登陆</button>
							<!-- <button class="notlogin_btn">注销</button> -->
							<a href="<{:U('Index/registration')}>">注册</a>
							
						</span>
						<!-- <button class="sign_btn">注册</button> -->
						<a class="login_after" href="<{:U('User/index')}>">个人主页</a>
						<a href="__PUBLIC__/HTML/vip_center.html">vip中心</a>
					</div>
				</div>
				<div>
					<img src="__PUBLIC__/PICTURE/HomePage/logo.jpg">
				</div>
				<div class="main_nav">
					<ul>
						<li><a href="<{:U('Index/index')}>">首页</a></li>
						<li><a href="<{:U('Gymnasium/index')}>">球场</a></li>
						<li><a href="<{:U('Club/index')}>">球会</a></li>
						<li>培训</li>
						<li><a href="<{:U('Activity/activity')}>">活动</a></li>
						<li><a href="<{:U('Coach/index')}>">教练</a></li>
						<li>竞赛</li>
						<li><a href="<{:U('Announce/index')}>">公告</a></li>
					</ul>
				</div>
			</div>
			<header class="row visible-xs visible-sm header_nav">
				<a href="<{:U('Coach/index')}>"><img src="__PUBLIC__/PICTURE/HomePage/pre.png"/></a>
				<span>教练详情页面</span>
			</header>
			<div class="club_content">
				<div class="club_nav">
				
				</div>
				<div class="club_messege">
					<div class="alley alley_detail">
						<div id="img">
						</div>
						<div class="message">
							<ul>
								<li id="name"></li>
								<li id="gender"></li>
								<li id="email"></li>
								<li id="phone"></li>
								<li id="introduction"></li>
								<li id="location"></li>
							</ul>
						</div>	
					</div>
					<div class="alley alley_detail">
						<div id="img1">
						</div>
						<div class="message">
							<ul>
								<li>课程介绍：</li>
								<li id="course_name"></li>
								<li id="course_status"></li>
								<li id="course_description"></li>
								<li><button class="join" type="button">报名课程</button></li>
							</ul>
						</div>	
					</div>
				</div>
			<!-- 	<div class="content_foot">
				</div> -->
			</div>
			</div>
			<div class="foot row">
				<div>
					<p>联系我们</p>
					<p>关于我们</p>
					<p>加入我们</p>
				</div>
				<div>
					<p>电话：400-800-8888 周一至周六9：00-18：00</p>
					<p>[羽乐汇]<a href="http://oto.my3w.com">http://oto.my3w.com</a></p>
				</div>
			</div>
		<script type="text/javascript">
		var course_id;
		var if_applied ;//报名是否成功
		//登陆验证
		var strCookie=document.cookie;
		var arrCookie=strCookie.split("; ");
		for(var i=0;i<arrCookie.length;i++){
             var arr=arrCookie[i].split("=");
             if("username"==arr[0]){
                    break;
             }
             else if(i ==arrCookie.length-1){
             	alert("请先登录");
             	window.location.href="<{:U('Login/userLogin')}>";
             }
		}
		<!------------------球会页面介绍------------------>
		resultList=<{$resultList}>;
		function setpage(){
			var img=resultList.coachResult.coach_picture;
			var coach_description=resultList.coachResult.coach_description;
			var coach_province=resultList.coachResult.coach_province;
			var coach_city=resultList.coachResult.coach_city;
			var coach_district=resultList.coachResult.coach_district;


			var name=resultList.userResult.name;
			var gender=resultList.userResult.gender;
			var email=resultList.userResult.email;
			var phone=resultList.userResult.phone;

			course_id=resultList.courseResult[0].course_id;
			var course_name=resultList.courseResult[0].course_name;
			var course_status=resultList.courseResult[0].course_status;
			var course_description=resultList.courseResult[0].course_description;
			var course_picture=resultList.courseResult[0].course_picture;
			$('#img').html('<img src="'+img+'">');
			$('#name').html("教练姓名："+name);
			if(gender==0){
				$('#gender').html("教练性别：男");
			}
			else{
				$('#gender').html("教练性别：女");
			}
			$('#email').html("教练邮箱："+email);
			$('#phone').html("教练电话："+phone);
			$('#introduction').html("教练简介："+coach_description);
			$('#location').html("教练所在地："+coach_province+coach_city+coach_district);

			$('#img1').html('<img src="'+course_picture+'">');
			$('#course_name').html("课程名："+course_name);
			if(course_status==0){
				$('#course_status').html("课程状态：预定");
			}
			else if(course_status==-1){
				$('#course_status').html("课程状态：结束");
			}
			else{
				$('#course_status').html("课程状态：第"+course_status+"节课");
			}
			$('#course_description').html("课程描述："+course_description);


		}
		setpage();
		<!------------------报名课程------------------>
		$('.join').bind('click',function(){
			$.post('__URL__/applyCourse',{'course_id':course_id},function(resultList){
				if_applied=resultList.result;
				if(if_applied == 0){
					alert("您已经报名");
				}
				else if(if_applied == 1){
					alert("您成功报名");
				}
				else if(if_applied == 2){
					alert("很抱歉报名失败");
				}
    	},'json');
		});
		
		</script>
	</body>
</html>
